package com.hainatong.shiphelper.module.warehouse.adapter;

import com.hainatong.shiphelper.databinding.ItemChukuViewBinding;
import com.hainatong.shiphelper.module.warehouse.entity.ChukuGoodsParam;
import org.jetbrains.annotations.NotNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder;
import com.hainatong.shiphelper.R;

public class ItemChukuAdapter extends BaseQuickAdapter<ChukuGoodsParam, BaseDataBindingHolder<ItemChukuViewBinding>>
{

    private boolean isShowMore = false;


    public boolean isShowMore()
    {
        return isShowMore;
    }

    public void setShowMore(boolean showMore)
    {
        isShowMore = showMore;
    }

    public ItemChukuAdapter()
    {
        super(R.layout.item_chuku_view);
    }

    @Override
    protected void convert(@NotNull BaseDataBindingHolder<ItemChukuViewBinding> bindingHolder, ChukuGoodsParam chukuBean)
    {
        ItemChukuViewBinding binding = bindingHolder.getDataBinding();
        if( binding != null )
        {
            if( isShowMore )
            {
                binding.btnMore.setImageResource( R.drawable.ic_more_vert_black );
            }
            else
            {
                binding.btnMore.setImageResource( R.mipmap.ic_delete_gray );
            }
            binding.setChukugoods( chukuBean );
            binding.executePendingBindings();
        }
    }
}
